import { fromJS } from 'immutable';
import * as constants from './constants';

const defaultState = fromJS({
  resourceType: [],
  typePageNum:0,
  allResource:[],
  subNumber:0,
  orgIdArr:[]
});

export default(state=defaultState, action) => {
  switch(action.type){
    // case constants.CHANGE_MENU:
    //   return state.set('currentMenu',action.current);
    case 'get_all_type':
      return state.merge({
        resourceType:action.resourceType,
        typePageNum:action.typePageNum
      })
    case 'all_select_sup':
      return state.set('allResource',action.allResource)
    case 'get_all_orgData':
      return state.set('orgIdArr',action.orgIdArr)
    default: return state;
  }
}